cmake_minimum_required(VERSION 3.2)

project(virtual_function_calls)

set(CMAKE_EXPORT_COMPILE_COMMANDS true)

add_library(c STATIC c.cpp)

add_custom_target(C_IR COMMAND clang -O2 -flto -fwhole-program-vtables ${CMAKE_SOURCE_DIR}/*.cpp -c)

add_dependencies(c C_IR)

add_executable(main main.cpp)

target_link_libraries(main c)
